/*
 * Main.java
 * Nov 13, 2009 1:06:57 PM
 */
package colors_flow;

import com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel;
import java.awt.Frame;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.border.EmptyBorder;
import javax.swing.plaf.metal.MetalLookAndFeel;

/**
 *
 * @author thirdy
 */
public class Main {

    static JFrame frame = new JFrame("Main");

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception {
        JFrame.setDefaultLookAndFeelDecorated(true);
        frame.setUndecorated(true);
        SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                try {
//                    UIManager.setLookAndFeel(new NimbusLookAndFeel());
                    frame.getRootPane().setBorder(new EmptyBorder(2, 2, 2, 2));
                    JPanel m = new MainPanel();
                    frame.setContentPane(m);
                    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    frame.pack();
                    frame.setLocationRelativeTo(null);

                    frame.setVisible(true);
                } catch (Exception e) {
                    e.printStackTrace();
//                    System.out.println("Substance Raven Graphite failed to initialize");
                }
            }
        });
    }

    static void max() {
        frame.setExtendedState(Frame.MAXIMIZED_BOTH);
    }

    static void min() {
        frame.setState(Frame.ICONIFIED);
    }
//    public static void main(String[] args) {
//        UIDefaults defaults = UIManager.getDefaults();
//        System.out.println(defaults.size() + " properties deffined !");
//        String[] colName = {"Key", "Value"};
//        String[][] rowData = new String[defaults.size()][2];
//        int i = 0;
//        Enumeration e = defaults.keys();
//        List keyList = Collections.list(e);
//        List toBeSortList = new ArrayList();
//        for (Object object : keyList) {
//            toBeSortList.add(  object.toString() );
//        }
//        Collections.sort(toBeSortList);
//        Enumeration sortedEnum = Collections.enumeration(toBeSortList);
//        e = sortedEnum;
//        for (; e.hasMoreElements(); i++) {
//            Object key = e.nextElement();
//            rowData[i][ 0] = key.toString();
//            rowData[i][ 1] = "" + defaults.get(key);
//            System.out.println(rowData[i][0] + " ,, " + rowData[i][1]);
//        }
//
//        JFrame f = new JFrame("UIManager properties default values");
//        JTable t = new JTable(rowData, colName);
//        f.setContentPane(new JScrollPane(t));
//        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//        f.pack();
//        f.setVisible(true);
//    }
}
